package com.jxt.myjxtmanager.ui.presenter;

import android.content.Context;


import com.jxt.myjxtmanager.entity.StuClassShowBean;
import com.jxt.myjxtmanager.ui.inter.StuClassShowInter;
import com.jxt.myjxtmanager.ui.model.StuClassShowMo;
import com.jxt.myjxtmanager.views.CustomProgressDialog;

import java.util.List;

/**
 * Created by qm on 2017/3/6 0006.
 */
public class StuClassShowPresenter implements StuClassShowMo.OnFindAllDataListener {
    private final CustomProgressDialog dialog;
    private StuClassShowMo showMo;
    private StuClassShowInter inter;

    public StuClassShowPresenter(Context cxt, StuClassShowInter inter) {
        this.inter = inter;
        showMo = new StuClassShowMo(cxt);
        showMo.setOnFindAllDevicesListener(this);
        dialog = new CustomProgressDialog(cxt, "");
    }

    public List<StuClassShowBean> getDataList() {
        return showMo.getQueryList();
    }

    public void dismissDialog() {
        if (dialog != null) {
            dialog.dismiss();
        }
    }
    public void RequestData() {
        if (dialog != null) {
            dialog.showDialog();
        }
        showMo.RequestData();
    }

    @Override
    public void onFindSuccess() {
        inter.setMyAdapter();
    }

    @Override
    public void OnFindAllDataSuccess(String strTitle) {

    }

    @Override
    public void onFailure() {

    }

    @Override
    public void onError() {

    }
}
